var pageii = null;
var grid = null;
$(function() {
	grid = lyGrid({
		pagId : 'paging',
		l_column : [ {
			colkey : "material_code",
			name : "物料编码"
		}, {
			colkey : "mold_code",
			name : "模具"
		}, {
			colkey : "packs",
			name : "包数"
		}, {
			colkey : "pieces",
			name : "件数"
		}, {
			colkey : "cname",
			name : "客户名称"
		}, {
			colkey : "finalEnterDate",
			name : "最后进仓"
		}, {
			colkey : "storageDay",
			name : "超期天数"
		}, {
			colkey : "abolishReason",
			name : "报废原因"
		}, {
			colkey : "price",
			name : "产品单价"
		}, {
			colkey : "total",
			name : "合计金额"
		}, {
			colkey : "dusername",
			name : "责任人"
		}, {
			colkey : "dutyAmount",
			name : "金额"
		}, {
			colkey : "ausername",
			name : "计划员"
		}, {
			colkey : "palnAmount",
			name : "金额"
		} ],
		jsonUrl : rootPath
				+ '/overtimeabolish_form/overtimeabolish_form_findByPage.shtml',
		dymCol : true,
		checkbox : true,
		serNumber : false
	});
	$("#editFun").click("click", function() {
		editAccount();
	});
	$("#search").click("click", function() {//  绑定查询按扭
		var searchParams = $("#searchForm").serializeJson();
		grid.setOptions({
			data : searchParams
		});
	});
});
function editAccount() {
	var cbox = grid.getSelectedCheckbox();
	if (cbox.length > 1 || cbox == "") {
		layer.msg("只能选中一个");
		return;
	}
	pageii = layer.open({
		title : "编辑超期报废申请表",
		type : 2,
		area : [ "800px", "100%" ],
		content : rootPath
				+ '/overtimeabolish_form/overtimeabolish_form_edit.shtml?id=' + cbox
	});
}

